<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head lang="en">
    <meta charset="UTF-8" />
    <title>TA的评论</title>
    <link href="/image/favicon.ico" rel="shortcut icon" />
    <script src="http://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" th:inline="javascript">
        /*<![CDATA[*/
        $(document).ready(function(){
            $("#iniPreference").click(function(){
                var r=confirm("重置喜好后你可以继续浏览新闻，或者重新登录选取喜好");
                if (r==true) {
                    window.location.href="/user/setUserPreference?preference=明星,时尚,影视,宠物,生活";
                } else {
                }
            });
        });
        /*]]>*/
    </script>
    <style type="text/css">
        body{margin: 0;
            background-color: #ebebeb;}
        .main{margin:0 auto;
            width:1080px}
        .left{float:left;
            width:200px;
            margin:0 20px;
            background-color:white;
            text-align:center}
        .right{float:left;}
        .comment{width:800px;
            margin-bottom:20px;
            background-color:white;
            padding:10px;
            -moz-box-shadow:2px 2px 5px #696969;
            -webkit-box-shadow:2px 2px 5px #696969;
            box-shadow:2px 2px 5px #696969;}
        .comtime{font-size:14px;
            color:#AAA}
        .context{}
        .nid{font-size:14px;
            color:#AAA}
        .button{
            height: 25px;
            border-radius: 5px;
            width: 40px;
            border: solid 0.5px;
            color: white;
            background-color: tomato;
        }
        .tag {
            text-align: left;
        }
        .tag ul{
            list-style: none;
            white-space: nowrap;
        }
        .tag ul li{
            border: 0px solid;
            border-radius: 25px;
            background-color: #e6e6e6;
            margin-top: 5px;
            padding: 3px 4px;
            color: #000000;
            margin-left: -38px;
        }
    </style>

</head>
<body>
<div th:include="header"></div>
<div class="main">
    <div style="height: 60px">将内容下移</div>
    <div class="left">
        <h3 th:text="${Username}">用户名</h3>
        <button id="iniPreference" class="button" style="width: 80px"
                th:if=${session.user!=null&&session.user.username==Username}>重置喜好</button>
        <div class="tag" th:utext="${tag}"></div>
    </div>
    <div class="right">
        <div class="comment" th:each="cs:${Comments}">
            <form style="float: right" th:if=${session.user!=null&&session.user.username==Username}
                  action="/comment/del" accept-charset="utf-8" method="post">
                <!--这条评论id-->
                <input type="hidden" name="id" th:value="${cs.id}">
                <input class="button" type="submit" value="删除">
            </form>
            <div class="comtime" th:text="${#dates.format(cs.comtime,'yyyy-MM-dd HH:mm:ss')}">时间</div>
            <br/>
            <div class="context" th:utext="${cs.context}">内容</div>
            <br/><br/>
            <div class="nid" th:utext="'来自:'+${cs.nid}">新闻</div>
        </div>
    </div>
</div>
</body>
</html>